/**
 * @date 2006-2-27 16:49:41
 *
 */
package org.nanhill.moo.web.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;

/**
 * @author alin [xalinx at gmail dot com]
 * 
 */
public class DispatcherController extends MultiSimpleViewController {
	private String adminCategoryView;

	private String adminCustomerView;

	private String adminInitSystemView;

	public void setAdminCategoryView(String adminCategoryView) {
		this.adminCategoryView = adminCategoryView;
	}

	public void setAdminCustomerView(String adminCustomerView) {
		this.adminCustomerView = adminCustomerView;
	}

	public void setAdminInitSystemView(String adminInitSystemView) {
		this.adminInitSystemView = adminInitSystemView;
	}

	public ModelAndView adminCategory(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		return new ModelAndView(adminCategoryView);
	}

	public ModelAndView adminCustomer(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		return new ModelAndView(adminCustomerView);
	}

	public ModelAndView adminInitSystem(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		String action = request.getParameter("action");
		Map<String, Object> map = new HashMap<String, Object>();
		if (null != action && action.equals("init")) {
			// InitDatabaseAction act = this.actionManager
			// .createAction(InitDatabaseAction.class);
			// act.act();
		}
		return new ModelAndView(adminInitSystemView, map);
	}
}
